﻿namespace zijian666.DI.Abstractions;

/// <summary>
/// 装配程序上下文
/// </summary>
public interface IAutowiredContext : IDisposable, IServiceProvider
{
    /// <summary>
    /// 添加待装配的服务实例
    /// </summary>
    void Add(object instance);

    /// <summary>
    /// 通过索引获取待装配的服务实例
    /// </summary>
    object this[int index] { get; }

    /// <summary>
    /// 获取待装配的服务实例数量
    /// </summary>
    int Count { get; }
    /// <summary>
    /// 是否已经释放
    /// </summary>
    bool Disposed { get; }

    IServiceProvider Services { get; }
}
